= gitlab_ui_form_for @application_setting, url: preferences_admin_application_settings_path(anchor: 'js-email-settings'), html: { class: 'fieldset-form' } do |f|
  = form_errors(@application_setting)

  %fieldset
    .form-group
      = f.gitlab_ui_checkbox_component :email_author_in_body, _('Include author name in notification email body'), help_text: _("Include the name of the author of the issue, merge request or comment in the email body. By default, GitLab overrides the email sender's name. Some email servers don't support that option.")
    .form-group
      = f.gitlab_ui_checkbox_component :html_emails_enabled, _('Enable multipart emails'), help_text: _('Send email in multipart format (HTML and plain text). Uncheck to send email messages in plain text only.')
    .form-group
      = f.label :commit_email_hostname, _('Custom hostname (for private commit emails)'), class: 'label-bold'
      = f.text_field :commit_email_hostname, class: 'form-control gl-form-input'
      .form-text.gl-text-subtle
        - commit_email_hostname_docs_link = link_to _('Learn more'), help_page_path('administration/settings/email.md', anchor: 'custom-hostname-for-private-commit-emails'), target: '_blank', rel: 'noopener noreferrer'
        = _("Hostname used in private commit emails. %{learn_more}").html_safe % { learn_more: commit_email_hostname_docs_link }

    = render_if_exists 'admin/application_settings/email_additional_text_setting', form: f

    .form-group
      = f.gitlab_ui_checkbox_component :user_deactivation_emails_enabled, _('Enable user deactivation emails'), help_text: _('Send emails to users upon account deactivation.')

    .form-group
      = f.label :deactivation_email_additional_text, _('Additional text for deactivation email')
      = f.text_area :deactivation_email_additional_text, class: 'form-control gl-form-input', rows: 4
      .form-text.gl-text-subtle
        = _('Text added to the body of user deactivation email messages. 1000 character limit.')

    = render 'admin/application_settings/resource_access_token_notify_inherited_settings', f: f

  = f.submit _('Save changes'), pajamas_button: true, data: { testid: 'save-changes-button' }
